'use strict';
module.exports = {
	/**
	 * 获取错题集列表
	 * @url client/quest-bank/kh/error/getInError 前端调用的url参数地址
	 * data 请求参数
	 * @param {String} params1  参数1
	 */
	main: async (event) => {
		let { data = {}, userInfo, util, filterResponse, originalParam } = event;
		let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
		let { uid, pageIndex, pageSize } = data;
		let res = { code: 0, msg: "" };
		// 业务逻辑开始-----------------------------------------------------------

		res = await vk.baseDao.selects({
			dbName: "q_user_error",
			getMain: false,
			pageIndex,
			pageSize,
			foreignDB: [{
				dbName: "questions",
				localKey: "question_id",
				foreignKey: "_id",
				as: "questions",
				limit: 1
			}],
			whereJson: { user_id: uid }
		});

		// 业务逻辑结束-----------------------------------------------------------
		return res;
	}
}
